package bist.believeinstep.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import bist.believeinstep.domain.Company;

public class CompanyMapper implements RowMapper<Company>{

	@Override
	public Company mapRow(ResultSet rs, int rowNum) throws SQLException {

		Company company = new Company();
		company.setId(rs.getInt("id"));
		company.setName(rs.getString("name"));
		company.setDob(rs.getDate("dob"));
		company.setTaxCode(rs.getString("tax_code"));
		company.setWebsite(rs.getString("website"));
		company.setAddress(rs.getString("address"));
		company.setEmail(rs.getString("email"));
		company.setHotline(rs.getString("hotline"));
		company.setPhone(rs.getString("phone"));
		company.setCellphone(rs.getString("cellphone"));
		company.setCreated(rs.getTimestamp("created_date"));
		company.setModified(rs.getTimestamp("modified_date"));
		company.setCreatedBy(rs.getString("created_by"));
		company.setModifiedBy(rs.getString("modified_by"));
		return company;
	}

}
